<title>已投项目</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<script type="text/javascript" src="#(path)/assets/js/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="#(path)/assets/js/jquery.tmpl.min.js"></script> 
#@checkToken()
<style> 
	body{font-family:"Microsoft YaHei",Arial,Helvetica,sans-serif,"宋体";}
	*{margin:0;padding:0;}
	li{list-style-type:none;}
	select,input{-webkit-appearance:none;border:0px;
		-webkit-tap-highlight-color: rgba(0, 0, 0, 0);   
	}
</style>
<body bgcolor="#f4f5f9" style="margin:0px;">
	<div align="center" style="width:100%;">
		<div style="background:#FFF;top:0px;position:fixed;height:50px;width:100%;">
			<div align="center" onclick="window.location.href='#(path)/app/page/personal-project'" style="border-bottom:2px solid #fa3048;float:left;width:49%;line-height:50px;color:#fa3048;">持有中</div>
			<div align="center" onclick="window.location.href='#(path)/app/page/personal-projectover'"  style="float:right;width:49%;line-height:50px;">已完成</div>
		</div>
		<div style="height:50px;"></div>
		<div id="alllist" align="center" style="padding-bottom:20px;"></div>
		<div id="showlists"></div>
	</div>
	
<script id="demo" type="text/x-jquery-tmpl">
	<div align="center" onclick="window.location.href='/app/page/personal-projectDetail?id=${id}'" style="height:130px;background:#FFF;width:100%;margin-top:10px;">
			<div style="width:1%;height:130px;float:left;background:#fa3048"></div>
			<div style="width:99%;float:left">
				<div style="margin-left:4%;height:40px;line-height:40px;">                        
					<div style="float:left;font-weight:600;font-size:14px;">
						<span>${name} </span>
						<span ${hid2} style="margin-left:5px;padding:3px 8px 3px 8px;font-size:12px;border-radius:5px;border:1px solid #fa3048;color:#fa3048">体验金可用</span>
						<span ${hid1} style="margin-left:5px;padding:3px 8px 3px 8px;font-size:12px;border-radius:5px;border:1px solid #fa3048;color:#fa3048">仅限一次</span>
					</div>
				</div>
				<div style="clear:both;width:96%;border-top:1px solid #f4f4f4;padding-top:5px;">
					<div style="width:33%;float:left;">
						<div style="height:30px;line-height:30px;"><span style="font-size:18px;color:#fa3048;height:60px;">${rate}%</span><span style="font-size:14px;color:#fa3048">+${plus_rate}%</span></div>
						<div style="font-size:14px;color:#8f8f8f;height:18px;line-height:18px;">预期年化</div>
					</div>
					<div style="width:33%;float:left;">
						<div style="height:30px;line-height:30px;"><span style="font-size:20px;color:#383838">${amount}</span><span style="color:#8f8f8f;font-size:14px;">元</span></div>
						<div style="font-size:14px;color:#8f8f8f;height:18px;line-height:18px;">投资金额</div>
					</div>
					<div style="width:33%;float:left;">         
						<div style="height:30px;line-height:30px;"><span style="font-size:16px;color:#383838">${shouyi}</span></div>
						<div style="font-size:14px;color:#8f8f8f;height:18px;line-height:18px;">预计收益</div>
					</div>
				</div>
				<div style="font-size:12px;width:96%;clear:both;margin-top:60px;border-top:1px solid #f4f4f4">
					<div align="left" style="padding-left:2%;float:left;width:100%;line-height:20px;color:#8f8f8f;">还款时间：<span>${invest_end_time}</span></div>
				</div>
			</div>
			
		</div>
</script>

<script type="text/javascript" src="/assets/dropload/dropload.min.js"></script>
<link rel="stylesheet" href="/assets/dropload/dropload.css">
<script>
var page = 0;
$('#alllist').dropload({
	scrollArea : window,
	loadDownFn : function(me){
		page++; 
		var url = "#(path)/trade/myList?token=#(session.token??)&size=10&status=holding&page="+page;
		console.log(page);
		$.getJSON(url, function(datalist) {
			$.each(datalist.data.page.list, function(i, item){ 
				console.log(item);
				var hid1 = "hidden";
				var hid2 = "hidden";
				if(item.status=="trading"){
					var shouyi = "等待满标";
					console.log(1);
					var invest_end_time = "等待满标";
				}else {
					var shouyi = item.total+"元";
					var invest_end_time = item.invest_end_time;
				}
				if(item.type=="first"){
					hid1 = "";
				}
				if(item.type=="experi"){
					hid2 = "";
				}
				var invests = {hid1:hid1,hid2:hid2,invest_end_time:invest_end_time,shouyi:shouyi,name:item.name,id:item.id,rate:item.rate,plus_rate:item.plus_rate,amount:item.amount};
				$("#demo").tmpl(invests).appendTo('#alllist');
			});
			
			$(".dropload-down").css("height","0px"); 
			if(!datalist.data.page.lastPage){
				me.resetload();	
			}
		});
	}
});			
</script> 



</body>